@extends('admin.layout')
@section('title', '网站 - 站点配置')
@section('content')
        <!-- 面包屑导航 -->
        <div class="row wrapper border-bottom white-bg page-heading" style="height: 40px;">
            <div class="col-sm-12">
                <ol class="breadcrumb" style="padding-top: 12px;">
                    <li>
                        <a href="index_v1.html">主页</a>
                    </li>
                    <li>
                        <strong>站点配置</strong>
                    </li>
                </ol>
            </div>
        </div>

        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>站点配置 <small>非必要填写可为空</small></h5>
                        </div>
                        <div class="ibox-content">
                            <div class="row">
                                <form role="form" id="form" enctype="multipart/form-data">
                                    <!-- 左边 -->
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label>网站名称</label>
                                        <input type="text" placeholder="请输入网站名称" value="{{$data['webtitle']}}" name="webtitle" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label>网站域名</label>
                                            <input type="text" placeholder="请输入网站域名" value="{{$data['weburl']}}" name="weburl" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label>站长邮箱</label>
                                            <input type="email" placeholder="请输入站长邮箱" value="{{$data['webemail']}}" name="webemail" class="form-control">
                                        </div>
                                        
                                        <div class="form-group">
                                            <label>版权信息</label>
                                            <textarea class="form-control" rows="3" name="webbq" placeholder="请输入版权信息">{{$data['webbq']}}</textarea>
                                        </div>
                                    </div>
                                    <!-- 右边 -->
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label>预留空位</label>
                                            <input type="text" name="webval" value="{{$data['webval']}}" placeholder="可输入任意内容" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label>备案信息</label>
                                            <input type="text" name="webicp" value="{{$data['webicp']}}" placeholder="请输入备案信息" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label>首页公告</label>
                                            <input type="text" name="webgg" value="{{$data['webgg']}}" placeholder="请输入首页公告" class="form-control">
                                        </div>
                                        <div class="form-group">
                                            <label>统计代码</label>
                                            <textarea class="form-control" name="webtj" rows="3" placeholder="请输入统计代码">{{$data['webtj']}}</textarea>
                                        </div>
                                        
                                        <div>
                                            <button class="btn btn-sm btn-info pull-right m-t-n-xs"
                                                type="button" id="hold"><strong>立即保存</strong>
                                            </button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
            $('#hold').click(function () {
                fd = new FormData(document.getElementById('form'));
                $.ajax({
                    url: 'webset',
                    type: 'POST',
                    timeout: 3000,
                    dataType: 'JSON',
                    contentType: 'application/x-www-form-urlencoded;charset=utf-8',
                    data: fd,
                    contentType: false,//不设置内容类型
                    processData: false,//不处理数据
                    success: function (data) {
                        if (data.code == 200) {
                            toastr.success(data.msg);
                        } else {
                            toastr.warning(data.msg);
                        }
                    },
                    error: function (XMLResponse) {
                        //异常捕获
                        toastr.error(XMLResponse.responseText);
                    }
                });
            });
            
        </script>
@endsection